<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<? include '../console/interview_console.php'; ?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link href="../css/iframe01.css" rel="stylesheet" type="text/css" />
<style type="text/css">
#title{
	font-weight:bold;
}

</style>
</head>

<?php
$interview=new interview();
$allitem2=$interview->getAllitem2();
?>

<body>
<table width="80%" id="table" cellpadding="5" class="table">
<tr id="title" align="left"><th>序号</th><th>姓名</th><th>面试职位</th><th width="150">面试时间</th><th>面试官</th><th>简历</th><th>面试结果</th></tr>
<?
if(isset($_GET['page'])){
	$page=$_GET['page'];
}else{
	$page=1;
}
$start=($page-1)*10;
$end=$start+10;

for($i=$start;$i<$end&&$i<count($allitem2);$i++){
	$number=$i+1;
	echo "<tr><td>".$allitem2[$i]['id']."</td><td>".$allitem2[$i]['name']."</td><td>".$allitem2[$i]['job']."</td><td>".$allitem2[$i]['date']."</td><td>".$allitem2[$i]['interviewer']."</td><td><a href='../file_operate/file_down.php?file_name=".$allitem2[$i]['resume']."'>下载</a></td><td>".$allitem2[$i]['result']."</td></tr>";
}
/*
foreach($allitem2 as $v){
	echo "<tr><td>$i</td><td>$v[name]</td><td>$v[job]</td><td>$v[date]</td><td>$v[interviewer]</td><td><a href='../file_operate/file_down.php?file_name=$v[resume]'>下载</a></td><td>$v[result]</td></tr>";
	$i++;
}
*/
?>
</table>

<div id="page_operate" align="center">
<input type="button" value="上一页" onclick="uppage()" class="button01" /><input type="button" value="下一页" onclick="downpage()" class="button01" />
</div>
</div>
</body>
<script language="javascript">
var page="<? echo $page;?>";
page=parseInt(page,10);
var array_length="<? echo count($allitem2); ?>";

function uppage(){
	page=page-1;
	if(page==0){
		alert("已达到首页!");
	}else{
		window.open("./interview_iframe_2.php?page="+page,"_self");
	}
}

function downpage(){
	var page_max=Math.ceil(array_length/10);
	page=page+1;
	if(page>page_max){
		alert("已达到尾页!");
	}else{
		window.open("./interview_iframe_2.php?page="+page,"_self");
	}
}
</script>
</html>